package com.linsir.lin.controller;

import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.pojo.BaseCode;
import com.linsir.lin.service.BaseCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping(value = "/baseCode")
public class BaseCodeController {

    @Autowired
    private BaseCodeService baseCodeService;

    @RequestMapping(value = "/grid",method = {RequestMethod.GET,RequestMethod.POST})
    public GridDTO<BaseCode> grid(String page,
                                  String limit,
                                  String searchParams) throws IOException {
        return  baseCodeService.grid( page,  limit,  searchParams);
    }
}
